@extends('shared.adminBase')
@section('title','编辑单页')
@section('content')
    <section class="content-header">
        <h1>编辑单页</h1>
        <ol class="breadcrumb">
            <li><a href="{{URL::action('AdminController@innerIndex')}}"><i class="fa fa-dashboard"></i> 首页</a>
            </li>
            <li class="active">编辑单页</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <!-- /.box -->
                <div class="box">
                    <!-- /.box-header -->
                    <div class="box-body col-md-12">
                        <div class="row">
                            <div class="col-md-12">
                                <!-- Custom Tabs -->
                                <div class="nav-tabs-custom">
                                    <ul class="nav nav-tabs">
                                        @foreach($pageList as $item)
                                            @if($item->single_page_id==$id)
                                                <li class="active"><a href="#tab{{$item->single_page_id}}"
                                                                      data-toggle="tab">{{App\Framework\Enum\SinglePageIdEnum::getName($item->single_page_id)}}</a>
                                                </li>
                                            @else
                                                <li><a href="#tab{{$item->single_page_id}}"
                                                       data-toggle="tab">{{App\Framework\Enum\SinglePageIdEnum::getName($item->single_page_id)}}</a>
                                                </li>
                                            @endif
                                        @endforeach
                                    </ul>
                                    <div class="tab-content">
                                        @foreach($pageList as $item)
                                        <div class="tab-pane{{$item->single_page_id==$id?' active':''}}" id="tab{{$item->single_page_id}}">
                                            <form action="{{URL::action('GameController@updateSinglePage')}}"
                                            method="post">
                                                {{csrf_field()}}
                                                <input name="id" type="hidden" value="{{$item->single_page_id}}">
                                            <div class="form-group">
                                            <label>页面内容<span style="color:red;">&nbsp;*</span></label>
                                            <textarea class="form-group"
                                            id="editor{{$item->single_page_id}}"
                                            name="content">{{$item->content}}</textarea>
                                            </div>
                                            <div class="form-group">
                                            <button type="submit" class="btn btn-default">
                                            提交
                                            </button>
                                            </div>
                                            </form>
                                        </div>
                                        @endforeach

                                    </div>
                                    <!-- /.tab-content -->
                                </div>
                                <!-- nav-tabs-custom -->
                            </div>
                            <!-- /.col -->
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>

@endsection
@include('UEditor::head')
@section('scripts')
    <script type="text/javascript">

        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        var ue1 = UE.getEditor('editor1', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });

        var ue2 = UE.getEditor('editor2', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });
        var ue3 = UE.getEditor('editor3', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });
        var ue4 = UE.getEditor('editor4', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });
        var ue5 = UE.getEditor('editor5', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });
        var ue6= UE.getEditor('editor6', {
            initialFrameHeight: 800,
            scaleEnabled: true
        });
    </script>
@endsection